﻿using System;
using System.Data;
using System.Configuration;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using System.Collections.Generic;
using HRProject.Code.Common;

namespace HRProject.Code.DTO
{
    public class BLGender
    {
        public static string GetName(int gender)
        {
            if (gender == 1)
            {
                return ContentProvider.GetValue("Gender_Male");
            }
            if (gender == 2)
            {
                return ContentProvider.GetValue("Gender_Female");
            }
            return ContentProvider.GetValue("Gender_Undefined");
        }

        public static List<GenderObject> List
        {
            get
            {
                List<GenderObject> result = new List<GenderObject>();
                result.Add(new GenderObject(0, ContentProvider.GetValue("Gender_Undefined")));
                result.Add(new GenderObject(1,ContentProvider.GetValue("Gender_Male")));
                result.Add(new GenderObject(2,ContentProvider.GetValue("Gender_Female")));
                return result;
            }
        }
    }

    public class GenderObject
    {
        private int id;
        private string name;

        public int Id
        {
            get { return id; }
            set { id = value; }
        }

        public string Name
        {
            get { return name; }
            set { name = value; }
        }

        public GenderObject(int pId, string pName)
        {
            id = pId;
            name = pName;
        }
    }
}
